import request from '@/utils/request'

export function getCategoriesList(params) {
  return request({
    url: '/categories',
    params
  })
}

export function addCategories(data) {
  return request({
    url: '/categories',
    method: 'post',
    data
  })
}

export function delCategories(id) {
  return request({
    url: `/categories/${id}`,
    method: 'delete'
  })
}

export function getCategoriesById(id) {
  return request({
    url: `/categories/${id}`
  })
}

export function editCategories(data) {
  return request({
    url: `/categories/${data.id}`,
    method: 'put',
    data
  })
}

export function getCategoriesCount(params) {
  return request({
    url: '/categories/count',
    method: 'get',
    params
  })
}
